#coding:utf-8

from db_base.TournamentServer import TM
import gevent
import datetime
import gameteammatch

class modifyeventstatus(object):
	def starting(self):
		while True:
			gevent.sleep(2)
			_now = datetime.datetime.now()
			event_d = TM.checkPlanEvent(_now, _now)
			for event in event_d:
				if event.get("has_teams")== event.get("max_teams"):
					## 队伍匹配规则
					# 判断赛事类型 已知类型有moba 大逃杀，足球----
					gameteammatch.Moba(TM, event)
				else:
					TM.update("hot_event",dict(status = 2),dict(id = event.get("id")))